package ${package}.service.impl;
import ${package}.dao.${table.className}Mapper;
import ${package}.service.${table.className}Service;
import ${package}.pojo.${table.className};
import ${package}.common.EmptyUtils;
import ${package}.common.Constants;
import ${package}.common.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class ${table.className}ServiceImpl implements ${table.className}Service {

@Resource
private ${table.className}Mapper ${table.lowerClassName}Mapper;

public ${table.className} get${table.className}ById(Long id)throws Exception{
return ${table.lowerClassName}Mapper.get${table.className}ById(id);
}
public Integer remove${table.className}ById(Long id)throws Exception{
return ${table.lowerClassName}Mapper.remove${table.className}ById(id);
}

public List<${table.className}>    get${table.className}ListByMap(Map
<String,Object> param)throws Exception{
List<${table.className}> list = ${table.lowerClassName}Mapper.get${table.className}ListByMap(param);
return list;
}

public Integer get${table.className}CountByMap(Map
<String,Object> param)throws Exception{
return ${table.lowerClassName}Mapper.get${table.className}CountByMap(param);
}

public Integer save${table.className}(${table.className} ${table.lowerClassName})throws Exception{
${table.lowerClassName}.setCreationDate(new Date());
return ${table.lowerClassName}Mapper.save${table.className}(${table.lowerClassName});
}

public Integer modify${table.className}(${table.className} ${table.lowerClassName})throws Exception{
${table.lowerClassName}.setModifyDate(new Date());
return ${table.lowerClassName}Mapper.modify${table.className}(${table.lowerClassName});
}
public Integer remove${table.className}ByIds(Long[] ids)throws Exception{
return ${table.lowerClassName}Mapper.remove${table.className}ByIds(ids);
}

public Page<${table.className}> query${table.className}PageByMap(Map<String,Object> param,Integer pageNo,Integer pageSize)throws Exception{
Integer total = ${table.lowerClassName}Mapper.get${table.className}CountByMap(param);
pageNo = EmptyUtils.isEmpty(pageNo) ? Constants.DEFAULT_PAGE_NO : pageNo;
pageSize = EmptyUtils.isEmpty(pageSize) ? Constants.DEFAULT_PAGE_SIZE : pageSize;
Page page = new Page(pageNo, pageSize, total);
param.put("beginPos", page.getBeginPos());
param.put("pageSize", page.getPageSize());
List<${table.className}> ${table.lowerClassName}List = ${table.lowerClassName}Mapper.get${table.className}ListByMap(param);
page.setRows(${table.lowerClassName}List);
return page;
}

}
